import { request } from "@/utils/http";
import {HospitalItem, HospitalList, HospitalRequest, ReqHospitalSetListRequest, addHospital, putHospital } from "./model/HospitalSetType";

// 初始化数据
export function getHospital({page,limit,hoscode,hosname}:HospitalRequest){
    return request.get<any,ReqHospitalSetListRequest>(`/admin/hosp/hospitalSet/${page}/${limit}`,
    {
        params:{
            hoscode,
            hosname
        }
    }
    )
}
// 添加数据
export function addHospitalValue(obj:addHospital){
    return request.post<any,null>("/admin/hosp/hospitalSet/save",obj)
}

// 根据ID查询数据
export function getHospitalID(id:string){
    return request.get<any,ReqHospitalSetListRequest>(`/admin/hosp/hospitalSet/get/${id}}`)
}

// put医院数据
export function putHospitalValue(obj:putHospital){
    return request.put("/admin/hosp/hospitalSet/update",obj)

}
// 删除单个医院数据
export function delHospital(id:number){
    return request.delete<any,null>(`/admin/hosp/hospitalSet/remove/${id}`)
}
// 批量删除医院
export function delHospitalList(idList:React.Key[]){
    return request.delete<any,null>("/admin/hosp/hospitalSet/batchRemove",{
        data:idList
    })
}

